package com.yan.dao.mapper;

import java.util.List;

import com.yan.dao.entity.Admin;
import com.yan.dao.entity.Borrows;
import com.yan.dao.entity.PersonMessage;
import com.yan.dao.entity.Reserve;
import com.yan.dao.entity.SuggestBuy;
import com.yan.dao.entity.Users;

public interface AdminMapper {
	//查询所有借阅记录
	List<Borrows> getBorrows(Borrows borrows);
	
	int getCount(Borrows borrow);
	
	int getCount2(Borrows borrow);
	//允许借阅
	void updateBorrows(Integer id);
	//不允许借阅
	void notAllowBorrows(Integer id);
	//添加未归还书籍
	void inserBackBooks(Integer id);
	//查看申请归还的书籍
	List<Borrows> getBackBooks(Borrows borrows);
	//同意归还
	void allowBackBook(Integer id);
	//显示所有用户申请预定书籍
	List<Reserve> getAllReserve();
	//同意申请预定书籍
	void updateReserveBook(Integer id);
	//查询管理员
	Admin getAdmin(Users user);
	//不同意申请预定书籍
	void notAllowReserveBook(Integer id);
	//添加归还书籍数目，先查询出borrows的id,根据borrows的bid得到book的ID
	int selectBorrowsId(Integer id);
	int selectBooksId(Integer id);
	//增加书籍数
	void updateBooks(Integer id);
	//减少书籍数量
	void descBooks(Integer id);
	//更新归还时间
	void updateBorrowsTime(Borrows borrow);
	//更新预定结束时间
	void updateReserveTime(Reserve reserve);
	
	//查询建构表
	List<SuggestBuy> selectSuggest(SuggestBuy suggestBuy);
	//查询表中数据的数量
	int getSuggestBuyCount();
	//同意购买
	void allowBuy(int id);
	//不同意购买
	void notAllowBuy(int id);
	
	//查询用户
	List<PersonMessage> getAllPersonMessage(Borrows borrow);
	//查询用户借阅情况
	List<Borrows> getUserBorrowsBooks(Borrows borrow);
	
	int getCount3(Borrows borrow);
}
